/***********************************************************
* 
*     File Name:  Parallel.cpp
* 
*        Author:  Algolc
* 
*          mail:  17360224@qq.com
* 
*  Created Time:  Thu 26 Jul 2018 10:28:55 AM CST
* 
***********************************************************/

#include <stdlib.h>
#include <atomic>
#include <thread>
#include <iostream>
using namespace std;

atomic_llong total {0};

void func(int) {
    for (long long i = 0; i < 100000000LL; ++i) {
        total += i;
    }
}

int main() {
    thread t1(func, 0);
    thread t2(func, 0);

    t1.join();
    ts.join();
    
    cout << total << endl;
    return 0;
}
